package conference.model;


/**
*
* the conference state used on the server side
* @author Samsjo-8
*/
public class ConferenceStateServerSide extends ConferenceState{
	
	private Client latestUserRemoved;
	private Client latestUserAdded;
	
	public static enum NOTIFICATION_SERVER {
		USER_LEFT_UPDATE,
		USER_JOINED_UPDATE,
		};  //CALL_STATE_UPDATE, //not used by server: does direct-update
	
	/**
	 * simple constructor for creating an empty state
	 */
	public ConferenceStateServerSide(){}
	

/**
*
* set which client was the one removed from the conference list
*
*/
	public void setLatestUserRemoved(Client c){
		latestUserRemoved=c;
		this.setChanged();
	    this.notifyObservers(NOTIFICATION_SERVER.USER_LEFT_UPDATE);
	}
	

/**
*
* set which client was the one added to the conference list
*
*/
	public void setLatestUserAdded(Client c){
		latestUserAdded=c;
		this.setChanged();
	    this.notifyObservers(NOTIFICATION_SERVER.USER_JOINED_UPDATE);
	}
	

/**
*
* @return the latest client added to the conference list
* 
*/
	public Client getLatestUserAdded(){
		return this.latestUserAdded;
	}
   

/**
*
* @return the latest client removed from the conference list
*
*/
	public Client getLatestUserRemoved(){
		return this.latestUserRemoved;
	}
	
	
	
	

	
	
	
}
